package zuoye3;

class Animal{
	String cry_;
	String animalName_;
	void cry(String m){
		this.cry_ = m;
	}
	String getCry() {
		return cry_;
	}
	void AnimalName(String n) {
		this.animalName_ = n;
	}
	String getAnimalName() {
		return animalName_;
	}
}

class Dog extends Animal{

}

class Cat extends Animal{
	
}

class Simulator{
	void playSound(Animal animal) {
		System.out.println("动物叫声是：" + animal.getCry() + " 动物是：" + animal.getAnimalName());
	}
}

public class Application {
	public static void main(String args[]) {
		Dog dog1 = new Dog();
		Cat cat1 = new Cat();
		dog1.cry("汪汪汪");
		dog1.AnimalName("狗狗");
		cat1.cry("喵喵喵");
		cat1.AnimalName("猫猫");
		
		Simulator simulator = new Simulator();
		simulator.playSound(dog1);
		simulator.playSound(cat1);
	}
}
